import { request } from '@/utils/request';

export default {
	login(data) {
		return request({
			url: '/auth/c/mall/wechat/loginByPhone',
			method: 'POST',
			data: {
				code: data.code,
				encryptedData: data.encryptedData,
				iv: data.iv,
			},
		});
	},
	info() {
		return request({
			url: '/auth/c/getLoginUser',
			method: 'GET',
		});
	},
	logout() {
		return request({
			url: '/logout',
			method: 'post',
		});
	},

	getWxUserInfo(data) {
		return request({
			url: '/auth/wechat/userInfo',
			method: 'GET',
			data: {
				code: data.code,
				encryptedData: data.encryptedData,
				iv: data.iv,
			},
		});
	},
};